OTUnbind
Dissociates an endpoint from its address or cancels an asynchronous call to theOTBind
function.C INTERFACE
OSStatus OTUnbind(EndpointRef ref);C++ INTERFACES
OSStatus TEndpoint::Unbind();PARAMETERS
ref
- The endpoint reference of the endpoint that you are unbinding.
DESCRIPTION
If you call theOTUnbind
function asynchronously and you have not installed a notifier function, the only way to determine that the endpoint has been unbound is to use theOTGetEndpointState
function to poll the state of the endpoint. The function returns thekOTStateChangeErr
result when theOTUnbind
function returns. If the function succeeds, the state of the endpoint isT_UNBND
. If it fails, its state isT_IDLE
.After you unbind an endpoint, you can no longer use it to send or receive information. You can use the
OTCloseProvider
function to deallocate memory reserved for the endpoint, or you can use theOTBind
function to associate it with another address and then resume transferring data or establishing a connection.SPECIAL CONSIDERATIONS
In asynchronous mode, the endpoint provider might call your notifier function before the function's initial return.VALID STATES
T_IDLE
COMPLETION EVENT CODES
T_UNBINDCOMPLETE
0x20000002 The OTUnbind
function has completed. Thecookie
parameter of the endpoint's notifier function is not used.SEE ALSO
To bind an endpoint, use theOTBind
function, described on page 3-77.To obtain information about the endpoint's state, use the
OTGetEndpointState
function, described on page 3-83.The
OTCloseProvider
function is described in the chapter "Providers" in
this book.